﻿import CMenuBox;
class CMenuGroup {
	var MenuArray:Array;
	public function CMenuGroup(value:Array) {
		if (value) {
			MenuArray = value;
		} else {
			MenuArray = getDefaultArray();
			//trace(MenuArray);
		}
	}
	public function TraceMe():Void{
		for(var i =0;i<MenuArray.length;i++)
		{
			trace("MenuBox item:"+ MenuArray[i].Caption);
			MenuArray[i].TraceMe();
		}
	}
	public function setMenuArray(value:Array):Void {
		MenuArray = value;
	}
	public function getMenuArray():Array {
		return MenuArray;
	}
	private function getDefaultArray():Array {
		var iArray:Array = new Array();
		var jArray:Array = new Array();
		//<node data=\"Resource\\3DMovie\\CarSpin_IonSedan.swf\" label=\"三维展示\" />
		var MenuClip:CMenuClip = new CMenuClip("三维展示", "Resource\\3DMovie\\CarSpin_IonSedan.swf");
		var tempStr:String = "Resource\\3DMovie\\CarSpin_IonSedan.swf";
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("流程动画", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("图片展示", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("设备结构", tempStr);
		jArray.push(MenuClip);
		var MenuBox:CMenuBox = new CMenuBox("三维演示系统", jArray);
		iArray.push(MenuBox);
		var jArray:Array = new Array();
		var MenuClip:CMenuClip = new CMenuClip("业务数据", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("业务流程", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("组织结构", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("处理方法", tempStr);
		jArray.push(MenuClip);
		var MenuBox:CMenuBox = new CMenuBox("业务数据系统", jArray);
		iArray.push(MenuBox);
		var jArray:Array = new Array();
		var MenuClip:CMenuClip = new CMenuClip("图纸资料", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("规章制度", tempStr);
		jArray.push(MenuClip);
		var MenuClip:CMenuClip = new CMenuClip("操作方法", tempStr);
		jArray.push(MenuClip);
		var MenuBox:CMenuBox = new CMenuBox("生产资料系统", jArray);
		iArray.push(MenuBox);
		return iArray;
	}
	private function getDefaultArray2():Array {
		var iArray:Array = new Array();
		//var jArray:Array = new Array();
		for (var i = 0; i<5; i++) {
			var _Caption:String = "菜单组"+i;
			var jArray:Array = new Array();
			for (var j = 0; j<5; j++) {
				var __Caption:String = "设备"+j;
				var __Action:String = "设备.任务"+j;
				var MenuClip:CMenuClip = new CMenuClip(__Caption, __Action);
				jArray.push(MenuClip);
			}
			var MenuBox:CMenuBox = new CMenuBox(_Caption, jArray);
			iArray.push(MenuBox);
		}
		return iArray;
	}
}
